<template>
  <div>
    <el-col v-for="item in colList" :key="item.label" :span="item.span || 12">
      <el-form-item :label="`${item.label}：`">
        <div v-if="item.isRate" class="rate-item">
          <el-rate v-model="colDetail[item.titleContent]" disabled />
        </div>
        <div
          v-else
          :title="item.title ? colDetail[item.titleContent] : ''"
          :class="[
            'ellipsis-3',
            {
              'success-row':
                highlightArr.length && highlightArr.includes(item.titleContent)
            }
          ]"
        >
          {{ colDetail[item.titleContent] }}
        </div>
      </el-form-item>
    </el-col>
  </div>
</template>

<script>
export default {
  name: "detailBaseColInfo",
  props: {
    colDetail: {
      type: Object,
      default: () => {}
    },
    colList: {
      type: Array,
      default: () => []
    },
    highlightArr: {
      type: Array,
      default: () => []
    }
  }
};
</script>

<style lang="scss" scoped>
/deep/.el-form-item {
  .rate-item {
    padding-top: 7px;
  }
}
</style>
